var fix_right=document.querySelector(".fix_right"),
	go_top=document.querySelector(".fix_right .go_top");
	scroll=document.body.scrollTop,
	h=document.body.scrollTop,
	is_run=false,
	fix_left=document.querySelector(".fix_left");
	
//点击回到顶部	
go_top.onclick=function(){
	scrToTop(40);
}
function scrToTop(num){
	var scrTop=document.documentElement.scrollTop+document.body.scrollTop;
	if(scrTop>0)
	{
		if(document.all)//支持IE
			scrTop-=num*2;
		else//非IE
			scrTop-=num;//scrTop=scrTop-num;			
		document.documentElement.scrollTop=scrTop;
		document.body.scrollTop=scrTop;
		return window.setTimeout(function(){scrToTop(num);},5);
	}
}

//滚动监听
window.addEventListener("scroll",function(){	
//	if(!is_run){
//		body_h=document.body.scrollTop;
//		if(body_h>220){
//			fix_right.style.display='block';
//		}else{
//			fix_right.style.display='';
//		}
//	}
!is_run?document.body.scrollTop>560?fix_left.style.display='block':fix_left.style.display='':'';
	!is_run?document.body.scrollTop>530?fix_right.style.display='block':fix_right.style.display='':'';
})